package com.github.freewu.mvp.view.status;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.lqkj.commons.R;

/**
 * Created by free on 16-7-20.
 */
public class ReloadView extends FrameLayout {
    private TextView errorText;

    public ReloadView(Context context) {
        super(context);

        init();
    }

    public ReloadView(Context context, AttributeSet attrs) {
        super(context, attrs);

        init();
    }

    public ReloadView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);

        init();
    }

    private void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.reload_layout, this);

        errorText = (TextView) findViewById(R.id.error_text);
    }

    public void setErrorText(String text) {
        if (errorText != null)
            errorText.setText(text);
    }
}
